
<!--
 * @Description: 用户登录日志 - 主页面
 * @Author: DSY
 * @Date: 2022-11-25 16:15:09
 * @LastEditors: DSY
 * @LastEditTime: 2022-11-25 16:15:09
-->
<template>
  <tw-layout
    @refresh="handleRefresh"
    @search="handleSearch"
    @reset="handleReset">
    <!-- 按钮组 -->
    <template #btns>
      <el-button
        class="item"
        type="danger"
        :loading="loadingByDel"
        :disabled="isSelectRows"
        v-auth="`ONLINE-DEL-LOGIC-BATCH`"
        @click="handleDelete()"
      >
        <svg-icon iconClass="delete"></svg-icon>
        批量删除
      </el-button>

      <!--<el-button class="item" type="primary" v-auth="`ONLINE-ADD`" @click="handleOpenForm('add')">
        <svg-icon iconClass="plus"></svg-icon>
        新增
      </el-button>-->
    </template>

    <!-- 查询表单 -->
    <template #header>
      <el-form ref="searchFormRef" :model="searchForm" label-width="90px">
        <el-row>

          <el-col :span="6">
            <el-form-item label="IP地址">
              <el-input v-model="searchForm.ip" clearable placeholder="请输入IP地址"></el-input>
            </el-form-item>
          </el-col>

          <el-col :span="6">
            <el-form-item label="登录名">
              <el-input v-model="searchForm.loginName" clearable placeholder="请输入登录名"></el-input>
            </el-form-item>
          </el-col>

          <el-col :span="6">
            <el-form-item label="类别">
              <el-input v-model="searchForm.type" clearable placeholder="请输入类别"></el-input>
            </el-form-item>
          </el-col>

          <el-col :span="6">
            <el-form-item label="用户登录类型">
              <el-input v-model="searchForm.loginType" clearable placeholder="请输入用户登录类型"></el-input>
            </el-form-item>
          </el-col>


          <el-col :span="6">
            <el-form-item label="操作时间">
              <el-date-picker v-model="searchForm.createDate" type="datetime" clearable placeholder="请选择操作时间"></el-date-picker>
            </el-form-item>
          </el-col>


        </el-row>
      </el-form>
    </template>

    <!-- 数据表格 -->
    <tw-table
      ref="tableRef"
      :loading="loading"
      :options="tableOptions"
      :events="tableEvents"
      :data="tableData"
      @search="searchList"
      exportExcelAuthKey="ONLINE-EXPORTEXCEL"
      @exportExcel="handleExport"
    >
      <template #action="{ row }">
        <!--<el-button link  type="warning" v-auth="`ONLINE-EDIT`" @click="handleOpenForm('edit', row)">
          编辑
        </el-button>-->
        <el-button link  type="danger" v-auth="`ONLINE-DEL-LOGIC-BATCH`" @click="handleDelete(row)">
          删除
        </el-button>
      </template>
    </tw-table>

    <onlineForm ref="formRef" @refreshTableData="handleRefresh"></onlineForm>
  </tw-layout>
</template>

<script src="./useIndex.ts"></script>

<style scoped lang="scss"></style>
